home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01lab4.zip / LRMRDR / LRM_CHAP.ZIP / CHAPAA.DOC < prev    next >
Text File  |  1992-04-21  |  26KB  |  957 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. The following document is a draft  of  the  corresponding  chapter  of  the
  7. version  of  the  Ada  Reference  Manual  produced  in response to the Ansi
  8. Canvass.  It is given a limited circulation  to  Ada  implementers  and  to
  9. other groups contributing comments (according to the conventions defined in
  10. RRM.comments).  This draft should not be referred to in any publication.
  11.  
  12.  
  13.  
  14.                        ANSI-RM-A-v23 - Draft Chapter
  15.  
  16.                      A  Predefined Language Attributes
  17.                                 version 23
  18.  
  19.                                  83-02-11
  20.  
  21.  
  22. This revision has considered all comments up to #5795
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. >                      A. Predefined Language Attributes
  78.  
  79.  
  80.  
  81. This  annex  summarizes  the  definitions given elsewhere of the predefined
  82. language attributes.
  83.  
  84.  
  85.  
  86. P'ADDRESS         For a prefix P that denotes an object, a program unit,  a
  87.                   label, or an entry:
  88.  
  89.                   Yields  the  address  of  the  first of the storage units
  90.                   allocated to P.  For a subprogram, package, task unit, or
  91.                   label, this value refers to the machine  code  associated
  92.                   with  the  corresponding body or statement.  For an entry
  93.                   for which an address clause has  been  given,  the  value
  94.                   refers  to  the  corresponding  hardware  interrupt.  The
  95.                   value of this attribute is of the type ADDRESS defined in
  96.                   the package SYSTEM.  (See 13.7.2.)
  97.  
  98. P'AFT             For a prefix P that denotes a fixed point subtype:
  99.  
  100.                   Yields the number of  decimal  digits  needed  after  the
  101.                   point  to  accommodate  the  precision  of the subtype P,
  102.                   unless the delta of the subtype P is greater than 0.1, in
  103.                   which case the attribute yields the value one.  (P'AFT is
  104.                   the smallest positive integer N for which (10**N)*P'DELTA
  105.                   is greater than or equal to  one.)   The  value  of  this
  106.                   attribute   is   of  the  type  universal_integer.   (See
  107.                   3.5.10.)
  108.  
  109. P'BASE            For a prefix P that denotes a type or subtype:
  110.  
  111.                   This attribute denotes the base type of P.   It  is  only
  112.                   allowed  as  the prefix of the name of another attribute:
  113.                   for example, P'BASE'FIRST.  (See 3.3.3.)
  114.  
  115. P'CALLABLE        For a prefix P that is appropriate for a task type:
  116.  
  117.                   Yields the value FALSE when the execution of the  task  P
  118.                   is  either  completed  or terminated, or when the task is
  119.                   abnormal;  yields the value TRUE otherwise.  The value of
  120.                   this attribute is of the predefined type  BOOLEAN.   (See
  121.                   9.9.)
  122.  
  123. P'CONSTRAINED     For a prefix P that denotes an  object  of  a  type  with
  124.                   discriminants:
  125.  
  126.                   Yields  the  value  TRUE  if  a  discriminant  constraint
  127.                   applies to the object P, or if the object is  a  constant
  128.                   (including a formal parameter or generic formal parameter
  129.                   of  mode in);  yields the value FALSE otherwise.  If P is
  130.                   a generic formal parameter of mode in out, or if P  is  a
  131.                   formal  parameter of mode in out or out and the type mark
  132.                   given  in  the  corresponding   parameter   specification
  133.                   denotes  an  unconstrained  type with discriminants, then
  134.                   the value of this attribute is obtained from that of  the
  135.                   corresponding   actual  parameter.   The  value  of  this
  136.                   attribute  is  of  the  predefined  type  BOOLEAN.   (See
  137.                   3.7.4.)
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191. P'CONSTRAINED     For a prefix P that denotes a private type or subtype:
  192.  
  193.                   Yields  the  value  FALSE  if  P denotes an unconstrained
  194.                   nonformal private type with discriminants;   also  yields
  195.                   the  value  FALSE  if  P denotes a generic formal private
  196.                   type and the  associated  actual  subtype  is  either  an
  197.                   unconstrained type with discriminants or an unconstrained
  198.                   array  type;  yields the value TRUE otherwise.  The value
  199.                   of this attribute is  of  the  predefined  type  BOOLEAN.
  200.                   (See 7.4.2.)
  201.                    1
  202.  
  203. P'COUNT           For a prefix P that denotes an entry of a task unit:
  204.  
  205.                   Yields  the number of entry calls presently queued on the
  206.                   entry (if the attribute is  evaluated  within  an  accept
  207.                   statement for the entry P, the count does not include the
  208.                   calling  task).   The  value  of this attribute is of the
  209.                   type universal_integer.  (See 9.9.)
  210.  
  211. P'DELTA           For a prefix P that denotes a fixed point  subtype:
  212.  
  213.                   Yields the value of the  delta  specified  in  the  fixed
  214.                   accuracy definition for the subtype P.  The value of this
  215.                   attribute  is  of the type universal_real.  (See 3.5.10.)
  216.  
  217. P'DIGITS          For a prefix P that denotes a floating point subtype:
  218.  
  219.                   Yields the  number  of  decimal  digits  in  the  decimal
  220.                   mantissa  of  model  numbers  of  the  subtype  P.  (This
  221.                   attribute yields the number D  of  section  3.5.7.)   The
  222.                   value of this attribute is of the type universal_integer.
  223.                   (See 3.5.8.)
  224.  
  225. P'EMAX            For a prefix P that denotes a floating point  subtype:
  226.  
  227.                   Yields the largest exponent value in the binary canonical
  228.                   form  of model numbers of the subtype P.  (This attribute
  229.                   yields the product 4*B of section 3.5.7.)  The  value  of
  230.                   this  attribute  is  of the type universal_integer.  (See
  231.                   3.5.8.)
  232.  
  233. P'EPSILON         For a prefix P that denotes a floating point subtype:
  234.  
  235.                   Yields the absolute value of the difference  between  the
  236.                   model number 1.0 and the next model number above, for the
  237.                   subtype  P.   The  value of this attribute is of the type
  238.                   universal_real.  (See 3.5.8.)
  239.  
  240. P'FIRST           For a prefix P that denotes a scalar type, or  a  subtype
  241.                   of a scalar type:
  242.  
  243.                   Yields the lower bound of P.  The value of this attribute
  244.                   has the same type as P.  (See 3.5.)
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256. P'FIRST           For a prefix P that is appropriate for an array type,  or
  257.                   that denotes a constrained array subtype:
  258.  
  259.                   Yields  the  lower  bound  of the first index range.  The
  260.                   value of this attribute has the same type as  this  lower
  261.                   bound.  (See 3.6.2 and 3.8.2.)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321. P'FIRST(N)        For a prefix P that is appropriate for an array type,  or
  322.                   that denotes a constrained array subtype:
  323.  
  324.                   Yields  the  lower  bound  of  the N-th index range.  The
  325.                   value of this attribute has the same type as  this  lower
  326.                   bound.   The  argument  N  must be a static expression of
  327.                   type universal_integer.  The value of N must be  positive
  328.                   (nonzero)  and  no greater than the dimensionality of the
  329.                   array.  (See 3.6.2 and 3.8.2.)
  330.  
  331. P'FIRST_BIT       For a prefix P that  denotes  a  component  of  a  record
  332.                   object:
  333.  
  334.                   Yields  the  offset,  from  the start of the first of the
  335.                   stora